/**
 * Copyright (c) 2015-2017, Henry Yang 杨勇 (gismail@foxmail.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.mapfinal.portal.model.sql;

import com.lambkit.db.sql.ConditionMode;
import com.lambkit.db.sql.column.Column;
import com.lambkit.db.sql.column.Columns;
import com.lambkit.db.sql.column.Example;

import java.io.Serializable;
import java.util.List;

/**
 * @author yangyong 
 * @website: www.lambkit.com
 * @email: gismail@foxmail.com
 * @date 2019-05-23
 * @version 1.0
 * @since 1.0
 */
public class OptionCriteria extends Columns implements Serializable {
	private static final long serialVersionUID = 1L;
	
	public static OptionCriteria create() {
		return new OptionCriteria();
	}
	
	public static OptionCriteria create(Column column) {
		OptionCriteria that = new OptionCriteria();
		that.add(column);
        return that;
    }

    public static OptionCriteria create(String name, Object value) {
        return (OptionCriteria) create().eq(name, value);
    }
    
    public Example example() {
    	return Example.create("cms_option", this);
    }
    
    /**
     * equals
     *
     * @param name
     * @param value
     * @return
     */
    public OptionCriteria eq(String name, Object value) {
    	super.eq(name, value);
        return this;
    }

    /**
     * not equals !=
     *
     * @param name
     * @param value
     * @return
     */
    public OptionCriteria ne(String name, Object value) {
    	super.ne(name, value);
        return this;
    }


    /**
     * like
     *
     * @param name
     * @param value
     * @return
     */

    public OptionCriteria like(String name, Object value) {
    	super.like(name, value);
        return this;
    }
    
    public OptionCriteria notLike(String name, Object value) {
    	super.notLike(name, value);
        return this;
    }

    /**
     * 大于 great than
     *
     * @param name
     * @param value
     * @return
     */
    public OptionCriteria gt(String name, Object value) {
    	super.gt(name, value);
        return this;
    }

    /**
     * 大于等于 great or equal
     *
     * @param name
     * @param value
     * @return
     */
    public OptionCriteria ge(String name, Object value) {
    	super.ge(name, value);
        return this;
    }

    /**
     * 小于 less than
     *
     * @param name
     * @param value
     * @return
     */
    public OptionCriteria lt(String name, Object value) {
    	super.lt(name, value);
        return this;
    }

    /**
     * 小于等于 less or equal
     *
     * @param name
     * @param value
     * @return
     */
    public OptionCriteria le(String name, Object value) {
    	super.le(name, value);
        return this;
    }
    
    public OptionCriteria isnull(String name) {
    	super.isnull(name);
        return this;
    } 

    public OptionCriteria notNull(String name) {
    	super.notNull(name);
        return this;
    } 
    
    public OptionCriteria empty(String name) {
    	super.empty(name);
        return this;
    } 
    
    public OptionCriteria notEmpty(String name) {
    	super.notEmpty(name);
        return this;
    } 
    
    public OptionCriteria add(Column column) {
    	super.add(column);
    	return this;
    }
    
    /**************************/
	
	public void addCriterion(String name, Object value, ConditionMode logic, String property, String typeHandler, String valueType) {
		 if (value == null) {
			 throw new RuntimeException("Value for " + property + " cannot be null");
		 }
		 add(Column.create(name, value, logic, typeHandler, valueType));
	}
   
	public void addCriterion(String name, Object value1, Object value2, ConditionMode logic, String property, String typeHandler, String valueType) {
		 if (value1 == null || value2 == null) {
			 throw new RuntimeException("Between values for " + property + " cannot be null");
		 }
		 add(Column.create(name, value1, value2, logic, typeHandler, valueType));
	}
		 
	public OptionCriteria andIdIsNull() {
		isnull("id");
		return this;
	}
	
	public OptionCriteria andIdIsNotNull() {
		notNull("id");
		return this;
	}
	
	public OptionCriteria andIdIsEmpty() {
		empty("id");
		return this;
	}

	public OptionCriteria andIdIsNotEmpty() {
		notEmpty("id");
		return this;
	}
       public OptionCriteria andIdEqualTo(java.lang.Long value) {
          addCriterion("id", value, ConditionMode.EQUAL, "id", "java.lang.Long", "Float");
          return this;
      }

      public OptionCriteria andIdNotEqualTo(java.lang.Long value) {
          addCriterion("id", value, ConditionMode.NOT_EQUAL, "id", "java.lang.Long", "Float");
          return this;
      }

      public OptionCriteria andIdGreaterThan(java.lang.Long value) {
          addCriterion("id", value, ConditionMode.GREATER_THEN, "id", "java.lang.Long", "Float");
          return this;
      }

      public OptionCriteria andIdGreaterThanOrEqualTo(java.lang.Long value) {
          addCriterion("id", value, ConditionMode.GREATER_EQUAL, "id", "java.lang.Long", "Float");
          return this;
      }

      public OptionCriteria andIdLessThan(java.lang.Long value) {
          addCriterion("id", value, ConditionMode.LESS_THEN, "id", "java.lang.Long", "Float");
          return this;
      }

      public OptionCriteria andIdLessThanOrEqualTo(java.lang.Long value) {
          addCriterion("id", value, ConditionMode.LESS_EQUAL, "id", "java.lang.Long", "Float");
          return this;
      }

      public OptionCriteria andIdBetween(java.lang.Long value1, java.lang.Long value2) {
    	  addCriterion("id", value1, value2, ConditionMode.BETWEEN, "id", "java.lang.Long", "Float");
    	  return this;
      }

      public OptionCriteria andIdNotBetween(java.lang.Long value1, java.lang.Long value2) {
          addCriterion("id", value1, value2, ConditionMode.NOT_BETWEEN, "id", "java.lang.Long", "Float");
          return this;
      }
        
      public OptionCriteria andIdIn(List<java.lang.Long> values) {
          addCriterion("id", values, ConditionMode.IN, "id", "java.lang.Long", "Float");
          return this;
      }

      public OptionCriteria andIdNotIn(List<java.lang.Long> values) {
          addCriterion("id", values, ConditionMode.NOT_IN, "id", "java.lang.Long", "Float");
          return this;
      }
	public OptionCriteria andKeyIsNull() {
		isnull("key");
		return this;
	}
	
	public OptionCriteria andKeyIsNotNull() {
		notNull("key");
		return this;
	}
	
	public OptionCriteria andKeyIsEmpty() {
		empty("key");
		return this;
	}

	public OptionCriteria andKeyIsNotEmpty() {
		notEmpty("key");
		return this;
	}
        public OptionCriteria andKeyLike(java.lang.String value) {
    	   addCriterion("key", value, ConditionMode.FUZZY, "key", "java.lang.String", "Float");
    	   return this;
      }

      public OptionCriteria andKeyNotLike(java.lang.String value) {
          addCriterion("key", value, ConditionMode.NOT_FUZZY, "key", "java.lang.String", "Float");
          return this;
      }
      public OptionCriteria andKeyEqualTo(java.lang.String value) {
          addCriterion("key", value, ConditionMode.EQUAL, "key", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andKeyNotEqualTo(java.lang.String value) {
          addCriterion("key", value, ConditionMode.NOT_EQUAL, "key", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andKeyGreaterThan(java.lang.String value) {
          addCriterion("key", value, ConditionMode.GREATER_THEN, "key", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andKeyGreaterThanOrEqualTo(java.lang.String value) {
          addCriterion("key", value, ConditionMode.GREATER_EQUAL, "key", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andKeyLessThan(java.lang.String value) {
          addCriterion("key", value, ConditionMode.LESS_THEN, "key", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andKeyLessThanOrEqualTo(java.lang.String value) {
          addCriterion("key", value, ConditionMode.LESS_EQUAL, "key", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andKeyBetween(java.lang.String value1, java.lang.String value2) {
    	  addCriterion("key", value1, value2, ConditionMode.BETWEEN, "key", "java.lang.String", "String");
    	  return this;
      }

      public OptionCriteria andKeyNotBetween(java.lang.String value1, java.lang.String value2) {
          addCriterion("key", value1, value2, ConditionMode.NOT_BETWEEN, "key", "java.lang.String", "String");
          return this;
      }
        
      public OptionCriteria andKeyIn(List<java.lang.String> values) {
          addCriterion("key", values, ConditionMode.IN, "key", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andKeyNotIn(List<java.lang.String> values) {
          addCriterion("key", values, ConditionMode.NOT_IN, "key", "java.lang.String", "String");
          return this;
      }
	public OptionCriteria andValueIsNull() {
		isnull("value");
		return this;
	}
	
	public OptionCriteria andValueIsNotNull() {
		notNull("value");
		return this;
	}
	
	public OptionCriteria andValueIsEmpty() {
		empty("value");
		return this;
	}

	public OptionCriteria andValueIsNotEmpty() {
		notEmpty("value");
		return this;
	}
        public OptionCriteria andValueLike(java.lang.String value) {
    	   addCriterion("value", value, ConditionMode.FUZZY, "value", "java.lang.String", "String");
    	   return this;
      }

      public OptionCriteria andValueNotLike(java.lang.String value) {
          addCriterion("value", value, ConditionMode.NOT_FUZZY, "value", "java.lang.String", "String");
          return this;
      }
      public OptionCriteria andValueEqualTo(java.lang.String value) {
          addCriterion("value", value, ConditionMode.EQUAL, "value", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andValueNotEqualTo(java.lang.String value) {
          addCriterion("value", value, ConditionMode.NOT_EQUAL, "value", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andValueGreaterThan(java.lang.String value) {
          addCriterion("value", value, ConditionMode.GREATER_THEN, "value", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andValueGreaterThanOrEqualTo(java.lang.String value) {
          addCriterion("value", value, ConditionMode.GREATER_EQUAL, "value", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andValueLessThan(java.lang.String value) {
          addCriterion("value", value, ConditionMode.LESS_THEN, "value", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andValueLessThanOrEqualTo(java.lang.String value) {
          addCriterion("value", value, ConditionMode.LESS_EQUAL, "value", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andValueBetween(java.lang.String value1, java.lang.String value2) {
    	  addCriterion("value", value1, value2, ConditionMode.BETWEEN, "value", "java.lang.String", "String");
    	  return this;
      }

      public OptionCriteria andValueNotBetween(java.lang.String value1, java.lang.String value2) {
          addCriterion("value", value1, value2, ConditionMode.NOT_BETWEEN, "value", "java.lang.String", "String");
          return this;
      }
        
      public OptionCriteria andValueIn(List<java.lang.String> values) {
          addCriterion("value", values, ConditionMode.IN, "value", "java.lang.String", "String");
          return this;
      }

      public OptionCriteria andValueNotIn(List<java.lang.String> values) {
          addCriterion("value", values, ConditionMode.NOT_IN, "value", "java.lang.String", "String");
          return this;
      }
}